<template>
  <div>

  </div>
</template>

<script>

import {HeatLayer} from 'maptalks.heatmap';

export default {
  name: 'ctMapHeat',
  components: {},
  props: {
    data: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  data: () => ({
    parentMap: null,
    heatVectorLayer: null,
  }),
  created() {
  },
  mounted() {
    const vue = this;
    this.$nextTick(() => {
      const {map} = this.$parent;
      map.removeLayer('heat');
      this.heatVectorLayer = new HeatLayer('heat').addTo(map);
      let transXYPoints = this.data
      vue.doRender(transXYPoints, this.heatVectorLayer);
    });
  },
  methods: {
    doRender(data, layer) {
      layer.setData(data);
    },
  },
};
</script>
